import 'package:flutter/material.dart';
import 'package:oktoast/oktoast.dart';
import 'package:provider/provider.dart';
import 'package:wan_android/app.dart';
import 'package:wan_android/model/fav/fav_page_model.dart';
import 'package:wan_android/model/home/home_page_model.dart';
import 'package:wan_android/model/project/project_page_model.dart';
import 'package:wan_android/model/search/search_page_model.dart';
import 'package:wan_android/model/user/user_page_model.dart';
import 'package:wan_android/utils/request.dart';

void main() async {
  // runApp(const WanApp());
  WidgetsFlutterBinding.ensureInitialized();
  await Request.instance;
  runApp(
    MultiProvider(
      providers: [
        ChangeNotifierProvider<HomePageModel>(create: (context) => HomePageModel()),
        ChangeNotifierProvider(create: (context) => SearchPageModel()),
        ChangeNotifierProvider(create: (context) => ProjectPageModel()),
        ChangeNotifierProvider(create: (context) => UserPageModel()),
        ChangeNotifierProvider(create: (context) => FavPageModel())
      ],
      child: const OKToast(child: WanApp())
    )
  );
}
